package com.member.shop.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.member.shop.domain.SysBizOrderGoods;
import com.member.shop.dto.OverviewDto;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 订单商品Mapper接口
 *
 * @author lixinchen
 * @date 2024-01-08
 */
public interface SysBizOrderGoodsMapper extends BaseMapper<SysBizOrderGoods> {
    /**
     * 查询订单商品
     *
     * @param id 订单商品主键
     * @return 订单商品
     */
    public SysBizOrderGoods selectSysBizOrderGoodsById(Long id);

    /**
     * 查询订单商品列表
     *
     * @param sysBizOrderGoods 订单商品
     * @return 订单商品集合
     */
    public List<SysBizOrderGoods> selectSysBizOrderGoodsList(SysBizOrderGoods sysBizOrderGoods);

    /**
     * 新增订单商品
     *
     * @param sysBizOrderGoods 订单商品
     * @return 结果
     */
    public int insertSysBizOrderGoods(SysBizOrderGoods sysBizOrderGoods);

    /**
     * 修改订单商品
     *
     * @param sysBizOrderGoods 订单商品
     * @return 结果
     */
    public int updateSysBizOrderGoods(SysBizOrderGoods sysBizOrderGoods);

    /**
     * 删除订单商品
     *
     * @param id 订单商品主键
     * @return 结果
     */
    public int deleteSysBizOrderGoodsById(Long id);

    /**
     * 批量删除订单商品
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteSysBizOrderGoodsByIds(Long[] ids);

    //商品订单总数
    Long todayOrderCount(OverviewDto overviewDto);

    //商品订单金额总数
    BigDecimal PlatformTotalOrderAmount(OverviewDto overviewDto);

    BigDecimal PlatformTotalOrderAmountAll(OverviewDto overviewDto);

    Long selectKillCount(@Param("id") Long id,@Param("startTime") Date startTime,@Param("endTime") Date endTime);
}
